function [G,XY] = getgraphDoublering(nnod);
% creates the graph of "ring" topology with (nnod) nodes:

al = 0:2*pi/(nnod-1):2*pi-1e-10;
XY = [cos(al),0; sin(al),0]';
G = sparse([1:nnod,nnod],[2:nnod,1,round(nnod/2)],1,nnod,nnod);
G = spones(G+G');
G = G-spdiags(diag(G),0,nnod,nnod);

